package StudySocket;

import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class StudyHttpRequest {
    //验证浏览器发过来的请求报文的格式
    public static void main(String[] args)throws Exception {
        ServerSocket serverSocket=new ServerSocket(10001);
        Socket socket=serverSocket.accept();
        InputStream netIn=socket.getInputStream();
        int x;
        while ((x=netIn.read())!=-1){
            System.out.print((char)x);
        }
        netIn.close();
        socket.close();
    }
}
